﻿<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <title>知深管理平台</title>
    <meta content="IE=edge,chrome=1" http-equiv="X-UA-Compatible">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="description" content="">
    <meta name="author" content="">

    <link rel="stylesheet" type="text/css" href="lib/bootstrap/css/bootstrap.css">
    <link rel="stylesheet" type="text/css" href="css/center.css">
    <link rel="stylesheet" type="text/css" href="stylesheets/theme.css">
    <link rel="stylesheet" href="lib/font-awesome/css/font-awesome.css">

    <script src="lib/jquery-1.8.1.min.js" type="text/javascript"></script>
    <script src="/js/jquery.form.js" type="text/javascript"></script>
    <link href="stylesheets/pager.css" rel="stylesheet" type="text/css" />
    <script src="javascripts/jquery.pager.js" type="text/javascript"></script>
    <script src="javascripts/sgl.js" type="text/javascript"></script>
    <!-- Demo page code -->

    <style type="text/css">
        #line-chart {
            height: 300px;
            width: 800px;
            margin: 0px auto;
            margin-top: 1em;
        }

        .brand {
            font-family: georgia, serif;
        }

            .brand .first {
                color: #ccc;
                font-style: italic;
            }

            .brand .second {
                color: #fff;
                font-weight: bold;
            }
    </style>

    <!-- Le HTML5 shim, for IE6-8 support of HTML5 elements -->
    <!--[if lt IE 9]>
      <script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
    <![endif]-->

    <!-- Le fav and touch icons -->
    <link rel="shortcut icon" href="../assets/ico/favicon.ico">
    <link rel="apple-touch-icon-precomposed" sizes="144x144" href="../assets/ico/apple-touch-icon-144-precomposed.png">
    <link rel="apple-touch-icon-precomposed" sizes="114x114" href="../assets/ico/apple-touch-icon-114-precomposed.png">
    <link rel="apple-touch-icon-precomposed" sizes="72x72" href="../assets/ico/apple-touch-icon-72-precomposed.png">
    <link rel="apple-touch-icon-precomposed" href="../assets/ico/apple-touch-icon-57-precomposed.png">
    <script src="javascripts/jquery.params.js"></script>

    <link rel="stylesheet" href="/kindeditor/themes/default/default.css" />
		<script charset="utf-8" src="/kindeditor/kindeditor-min.js"></script>
		<script charset="utf-8" src="/kindeditor/lang/zh_CN.js"></script>
		 <script>
		     var editor1;
		     KindEditor.ready(function (K) {
		         editor1 = K.create('#act_Descriptions', {
		             cssPath: '/kindeditor/plugins/code/prettify.css',
		             uploadJson: '/kindeditor/asp.net/upload_json.ashx',
		             fileManagerJson: '/kindeditor/asp.net/file_manager_json.ashx',
		             allowFileManager: true,
		             allowImageUpload: true

		         });
		     });
    </script>
    <script type="text/javascript">
				$(function(){
					alert("1");
					$(".add-spec").live("click",function(){
						var tr = $(this).parents("tr").clone();
						$(this).parents("tr").after(tr);
						tr.find(".add-spec").remove();
						var del = '<a href="javascript:;" class="hd-btn hd-btn-success hd-btn-sm del-spec">删除</a>'
						tr.find("td").eq(5).append(del);
					})
				})
			</script>
			<script type="text/javascript">
				$(function(){
					$(".del-spec").live("click",function(){
						$(this).parents("tr").remove();
					})
				})
			</script>
</head>

<!--[if lt IE 7 ]> <body class="ie ie6"> <![endif]-->
<!--[if IE 7 ]> <body class="ie ie7"> <![endif]-->
<!--[if IE 8 ]> <body class="ie ie8"> <![endif]-->
<!--[if IE 9 ]> <body class="ie ie9"> <![endif]-->
<!--[if (gt IE 9)|!(IE)]><!-->
<body>
    <!--<![endif]-->

    <div class="navbar">
        <div class="navbar-inner">
            <div class="container-fluid">
                <ul class="nav pull-right">

                    <li id="fat-menu" class="dropdown">
                        <a href="#" id="drop3" role="button" class="dropdown-toggle" data-toggle="dropdown">
                            <i class="icon-user"></i>
                            <i class="icon-caret-down"></i>
                        </a>

                        <ul class="dropdown-menu">
                            <li><a tabindex="-1" href="#">Settings</a></li>
                            <li class="divider"></li>
                            <li><a tabindex="-1" href="sign-in.html">Logout</a></li>
                        </ul>
                    </li>

                </ul>
                <a class="brand" href="index.html"><span class="first">知深管理平台</span> <span class="second"></span></a>
            </div>
        </div>
    </div>


    <div class="container-fluid">

        <div class="row-fluid">
            <div class="span3">
                <div class="sidebar-nav">
                </div>
            </div>
            <div class="span9">
                <h1 class="page-title">课程小节</h1>
                <div class="btn-toolbar">
                    <button class="btn btn-primary" onclick="cateSave()"><i class="icon-save"></i>Save</button>

                    <div class="btn-group">
                    </div>
                </div>

                <div class="well">
                    <ul class="nav nav-tabs">
                        <li class="active"><a href="javascript:void(0)" id="cate_edit" data-toggle="tab">编辑</a></li>

                    </ul>
                    <div id="myTabContent" class="tab-content">
                        <div class="tab-pane active in" id="home">
                            <form id="zs_act" action="" method="post" enctype="multipart/form-data">
                               <label>所属学术培训</label>
                                <select name="ddlCate" id="ddlCate" class="input-xlarge" style="margin-bottom:10px;">
                                    <option value="0">请选择...</option>
                                </select> 

                 <table class="hd-table hd-table-form" id='spec' style="border-top:1px solid #E5E5E5 ;">
				
				
				<tr>
					<td>标题</td>
					<td>
						<input type="text" name="" id="" value="" />
					</td>
					<td>开始时间</td>
					<td>
						<input type="text" name="" id="" value="" />
					</td>
					<td>结束时间</td>
					<td>
						<input type="text" name="" id="" value="" />
					</td>
					
					<td>
						<a href="javascript:;" class="hd-btn hd-btn-success hd-btn-sm add-spec">添加</a>
					</td>
				</tr>
				
				
			</table>
                
                            </form>
                        </div>

                    </div>

                </div>




            </div>
        </div>



        <footer>
            <hr>

            <p class="pull-right">Collect from <a href="http://www.17sucai.com/" title="网页模板" target="_blank">网页模板</a></p>


            <p>&copy; 2012 <a href="#">Portnine</a></p>
        </footer>




        <!-- Le javascript
    ================================================== -->
        <!-- Placed at the end of the document so the pages load faster -->
        <script src="lib/bootstrap/js/bootstrap.js"></script>

        <script>

            $(function () {
                getBinp_left(); GetCateData(4);
                var proid = $.query.get("proid");
                if (proid.length == 0) { $("#cate_edit").text("添加"); }
                else
                {
                    $.ajax({
                        type: "post", url: "/app/get_zs_binp.ashx",
                        data: { "por": "1901", "proid": proid },
                        async: false, dataType: "json", success: function (data) {
                            if (data.code == 1) {
                                $("#pro_title").val(data.info.LTitle);
                                $("#pro_img_show").attr("src", data.info.LImgUrl);
                                $("#sdate").val(data.info.RecruitStart.substring(0, 10));
                                $("#stime").val(data.info.RecruitStart.substring(11, 50));
                                $("#edate").val(data.info.RecruitEnd.substring(0, 10));
                                $("#etime").val(data.info.RecruitEnd.substring(11, 50));
                                $("#ddlIsState").val(data.info.LState);
                                $("#ddlCate").val(data.info.LGuid);
                                $("#ddlIsRe").val(data.info.LISRecommend);
                                $("#act_Descriptions").val(data.info.LContent);
                                $("#Lid").val(data.info.LiveId);
                            } else { alert(data.msg); }
                        }
                    });

                }


            })
            function cateSave() {
                //获取 table 元素
                var table = document.getElementById('table');
                //获取 table 内的全部 input
                var textinputs = table.getElementsByTagName('input');
                //循环
                for (var i = 0; i < textinputs.length; i++) {
                    //将 textinput 的值置于 textinput 上一级 td 节点的下一个同级 td 节点中
                    //alert(textinputs[i].value);
                    textinputs[i].parentNode.nextSibling.innerHTML = textinputs[i].value;
                }
                //var title = $("#pro_title").val();
                //var img = $("#pro_img_show").attr("src");
                var star_time = $("#sdate").val() + " " + $("#stime").val();
                var end_time = $("#edate").val() + " " + $("#etime").val();
                var isState = $("#ddlIsState").val();
                var ddlCate = $("#ddlCate").val();
                var LiveId = $("#Lid").val();
                //var hotStr = $("#ddlIsRe").val();
                var proid = $.query.get("proid");

                if (title.length > 0 && star_time.length > 0 && LiveId.length > 0 && ddlCate.length > 0) {
                    $.ajax({
                        type: "post", url: "/app/get_zs_binp.ashx",
                        data: { "por": "190", "proid": proid, "title": title, "img": img, "descriptions": editor1.html(), "timeStartStr": star_time, "timeOverStr": end_time, "isState": isState, "ddlCate": ddlCate, "LiveId": LiveId, "hotStr": hotStr },
                        async: false, dataType: "json", success: function (data) {
                            if (data.code == 1) {
                                window.location.href = "liveList.html";

                            } else { alert(data.msg); }
                        }
                    });
                } else { alert("此项不能为空"); }
            }

            //直播对应的培训
            function GetCateData(cateid) {
                $.ajax({
                    type: "post", url: "/app/get_zs_binp.ashx",
                    data: { "por": "1902", "cateid": cateid },
                    async: false, dataType: "json", success: function (data) {

                        if (data.code == 1) {
                            var con = '';
                            con = '<option value="0">请选择...</option>';
                            for (var i = 0; i < data.list.length; i++) {
                                con += "<option value=\"" + data.list[i].Guid + "\"  >" + data.list[i].Title + "</option>";
                            }
                            $("#ddlCate").html(con);


                        } else { alert(data.msg); }
                    }
                });
            }
        </script>
<script type="text/javascript">
				$(function(){
					alert("1");
					$(".add-spec").live("click",function(){
						var tr = $(this).parents("tr").clone();
						$(this).parents("tr").after(tr);
						tr.find(".add-spec").remove();
						var del = '<a href="javascript:;" class="hd-btn hd-btn-success hd-btn-sm del-spec">删除</a>'
						tr.find("td").eq(4).append(del);
					})
				})
			</script>
			<script type="text/javascript">
				$(function(){
					$(".del-spec").live("click",function(){
						$(this).parents("tr").remove();
					})
				})
			</script>
</body>
</html>
  <link rel="stylesheet" href="/css/bootstrap-datetimepicker.min.css">
<script src="/js/create.js"></script>
    <script src="/js/bootstrap-datetimepicker.min.js"></script>
    <script type="text/javascript" src="/js/swfupload.js"></script>
 <script src="/js/vhallApp.js" type="text/javascript"></script>
<script>
    var accountType = '3';
    var webinar_top = 0;
    $(document).ready(function (e) {


        var now_date = new Date().Format('yyyy-MM-dd');
        //var now_time = new Date().Format('hh:mm:ss');
        $('.form_date').datetimepicker({
            language: 'fr',
            weekStart: 1,
            todayBtn: 1,
            autoclose: 1,
            todayHighlight: 1,
            startView: 2,
            minView: 2,
            startDate: now_date,
            forceParse: 0
        });
        $('.form_time').datetimepicker({
            language: 'fr',
            weekStart: 1,
            todayBtn: 0,
            autoclose: 1,
            todayHighlight: 1,
            startView: 1,
            //startDate:'1899-12-31 '+now_time,
            minView: 0,
            maxView: 1,
            forceParse: 0
        });
        $(".create-event").css("height", 'auto');
    });
</script> 



